package com.print;

import mycoffee.order.R;
import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class PasswordDialog extends Dialog {
	// Declare context variable
	Context mContext;
	// declare component object
	EditText etPassword;
	Button btLogin;
	private final static String PASS_WORD = "123456";
	
	//Constructor
	public PasswordDialog(Context context) {
		super(context);
		mContext = context;
	}

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.password_dialog);
		setTitle(mContext.getString(R.string.admin_pass));
		etPassword = (EditText)findViewById(R.id.etAdminPassword);
		btLogin = (Button)findViewById(R.id.btLogin);
		btLogin.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				if (TextUtils.equals(PASS_WORD, etPassword.getText()
								.toString())) {
					// start dialog to input password.
					// start dialog to input password.
					
					dismiss();
				}
			}
		});		
	}
}
